<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue3-escook</title>
  <link rel="stylesheet" href="./lib/style.css">
  <script type="importmap">
    {
      "imports" : {
        "vue": "./lib/vue-3.4.29.js"
      }
    }
  </script>
  <script type="module">
    import { createApp, ref, computed } from 'vue'

    const app = createApp({
      setup() {
        const fontSize = ref(12)
        const color = ref('#ffffff')

        // 计算属性
        const styleObj = computed(() => ({ 'font-size': fontSize.value + 'px', color: color.value }))

        return {
          fontSize,
          color,
          styleObj
        }
      }
    })

    app.mount('#app')
  </script>
</head>

<body>
  <div id="app">
    <button @click="fontSize += 2">fontSize +2</button>
    <input type="color" v-model="color">

    <!-- <h1 style="font-style: italic;" :style="{ 'font-size': fontSize + 'px', color }">Liu LongBin</h1> -->
    <h1 style="font-style: italic;" :style="styleObj">Liu LongBin</h1>
  </div>
</body>

</html>